package cn.edu.scau.cmi.zengdefeng.Composite;

import java.util.HashSet;
import java.util.Set;

public abstract class SafeComponent {
	
	private SafeComponent parent;
	private String name;
	public SafeComponent(SafeComponent parent, String name) {
		this.parent = parent;
		this.name = name;
	}

	//	(1)业务功能
	@Override
	public String toString() {
		return toString(1);
	}
	
	abstract String toString(int cent);
	
	//	(2)获取包含对象的功能
	SafeComponent getParent() {
		return parent;
	}

	public void setParent(SafeComponent parent) {
		this.parent = parent;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	

}
